﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:markup="clr-namespace:Elysium.Markup"
                    xmlns:params="clr-namespace:Elysium.Parameters">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/Themes/SharedResources.xaml"/>
        <ResourceDictionary Source="pack://application:,,,/Themes/Ranges/Slider.Resources.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <ControlTemplate x:Key="VerticalSliderTemplate" TargetType="{x:Type Slider}">
        <Grid Background="{TemplateBinding Background}"
              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <TickBar Grid.Column="0"
                     Fill="{TemplateBinding BorderBrush}"
                     Placement="Top"
                     Width="{TemplateBinding params:Slider.TrackSize}"
                     Visibility="Collapsed"/>
            <Rectangle x:Name="PART_SelectionRange"
                       Grid.Column="1"
                       Fill="{markup:ThemeResource BackgroundContrastBrush}"
                       StrokeThickness="0"
                       Width="{TemplateBinding params:Slider.TrackSize}"
                       Visibility="Hidden"/>
            <Track x:Name="PART_Track"
                   Grid.Column="1"
                   HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <Track.DecreaseRepeatButton>
                    <RepeatButton Command="{x:Static Slider.DecreaseLarge}"
                                  IsEnabled="{TemplateBinding IsEnabled}"
                                  Width="{TemplateBinding params:Slider.TrackSize}"
                                  Style="{StaticResource SliderRepeatButtonValuableStyle}"/>
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb BorderThickness="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.DefaultPaddingValue), Mode=OneWay, Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter=Top}"
                           IsEnabled="{TemplateBinding IsEnabled}"
                           Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ActualWidth, Mode=OneWay}"
                           Height="{TemplateBinding params:Slider.ThumbThickness}"
                           Style="{StaticResource SliderThumbStyle}"/>
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton Command="{x:Static Slider.IncreaseLarge}"
                                  IsEnabled="{TemplateBinding IsEnabled}"
                                  Width="{TemplateBinding params:Slider.TrackSize}"
                                  Style="{StaticResource SliderRepeatButtonStyle}"/>
                </Track.IncreaseRepeatButton>
            </Track>
            <TickBar Grid.Column="2"
                     Fill="{TemplateBinding BorderBrush}"
                     Placement="Bottom"
                     Width="{TemplateBinding params:Slider.TrackSize}"
                     Visibility="Collapsed"/>
        </Grid>
    </ControlTemplate>
    
</ResourceDictionary>